package com.hdax.dm.vo;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.time.LocalDateTime;

@Document(indexName = "dm_item")
@Data
public class EsItem {

    @Id
    private Long id;

    @Field(value = "imageurl",type = FieldType.Text)
    private String imageUrl;

    @Field(value = "areaname",analyzer = "ik_max_word",type = FieldType.Text)
    private String areaName;

    @Field(value = "itemname",analyzer = "ik_max_word",type = FieldType.Text)
    private String itemName;

    @Field(value = "abstractmessage",analyzer = "ik_max_word",type = FieldType.Text)
    private String abstractMessage;

    @Field(value = "itemtype1id",type = FieldType.Integer)
    private int itemTypeId1;

    @Field(value = "itemtype2id",type = FieldType.Integer)
    private int itemTypeId2;

    @Field(value = "starttime",type = FieldType.Date,format = DateFormat.date_optional_time)
    private LocalDateTime startTime;

    @Field(value = "endtime",type = FieldType.Date,format = DateFormat.date_optional_time)
    private LocalDateTime endTime;

    @Field(value = "createdtime",type = FieldType.Date,format = DateFormat.date_optional_time)
    private LocalDateTime createdTime;

    @Field(value = "updatedtime",type = FieldType.Date,format = DateFormat.date_optional_time)
    private LocalDateTime updatedTime;

    @Field(value = "address",type = FieldType.Text)
    private String address;

    @Field(value = "maxprice",type = FieldType.Float)
    private Double maxPrice;

    @Field(value = "minprice",type = FieldType.Float)
    private Double minPrice;

    @Field(value = "latitude",type = FieldType.Text)
    private String latitude;

    @Field(value = "longitude",type = FieldType.Text)
    private String Longitude;

}
